1. Field of the Invention
The present invention relates to an image compression device, a compressing method, and a program capable of realizing two types (natural images such as movies etc. and CG images such as a digital map etc.) of high quality images having different characteristics in real time, and an image decompression device, a decompressing method, and a program capable of decompressing compressed image data.
2. Description of the Related Art
It is necessary to compress data to transmit image information containing an large amount of information. Especially, since 30 through 60 frames of image data are transmitted and received for moving pictures, the data compression is required.
It is well known that image information can be natural images such as general television images, movies, etc. and CG images represented by maps for car navigation etc. Generally, natural images contains a number of low-frequency components, and digital images contains a number of high-frequency components. In a recent mobile terminal such as a car-mounted terminal, a mobile telephone, etc., both digital images such as a map etc. and natural images such as TV and movie pictures etc. are processed. To efficiently transmit both types of image data, an effective data compressing system for both low-frequency components and high-frequency components is desired.
The first conventional technology using a DPCM prediction device shown in FIG. 1 is knows as a common conventional image data compressing system. As shown in FIG. 1, when image data 110 is compressed, a prediction unit (DPCM) 210 predicts a value of a pixel to be predicted from the line preceding a target pixel and the value of a preceding pixel, converts a prediction error from an actual pixel level value into a representative value, quantizes the value using a quantizer 310, and transmits a quantized value through a variable-length encoder 410 for assigning a code depending on the frequency of occurrence. In this system, both high-frequency components and low-frequency components can be processed in a pixel unit for quantization and encoding. However, since a prediction value is calculated on the basis of the value of the preceding line, an error is used during the next predicting process if the error occurs at any point. As a result, the prediction error propagates and causes image degradation along the line.
For example, when a quantization table used by the quantizer 310 has the prediction error value of −4 through 4 as a quantization prediction error of 0 (that is, a quantization table having a rough quantization width), the quantization prediction error is assumed as 0 although a prediction error of the value of −4 through 4 occurs in any predicting process by the prediction unit (DPCM) 210. Therefore, the information that the prediction error has occurred cannot be included in the quantization result, and the prediction error remains as is. If the propagation of the prediction error occurs, a line unexpectedly occurs in the direction of the line in an image output as a process result, thereby causing image degradation.
Additionally, as a conventional image data compressing system, the second conventional technology of compressing data by a JPEG (joint photographic experts group) and a MPEG (moving picture experts group) as shown in FIG. 2 is well known. The following patent documents 1 and 2 belong to the second conventional technology. As shown in FIG. 2, the second conventional technology divides an input image 120 into blocks (normally 8*8 pixels) 130, applies DCT 220 to the block image, performs quantization 320 on a DCT coefficient, performs variable-length encoding 420 for assigning a code depending on the frequency of occurrence, and transmit the result. A DCT (discrete cosine transfer) is a method for applying frequency transform to an image data. Since human eyes are sensitive to low-frequency components (flat portion in an image), the DCT coefficient for a low frequency is precisely quantized, and the DCT coefficient for a high frequency is roughly quantized, thereby compressing natural images at a high compression rate at which image degradation can be inconspicuous. However, there is no problem with the compression of natural images when conspicuous low-frequency components are precisely quantized, but the image degradation is conspicuous on the high-frequency components such as a line and a character in map images (CG images). Furthermore, since edge information extraction 230 is performed on a block to be compressed, there is the problem that correction and feedback cannot be performed by detecting the image degradation caused by a quantization error.
Furthermore, although not shown in the attached drawings, the third conventional technology using a JPEG-LS (lossless) is known as a conventional image data compressing system. The third conventional technology predicts a value by a MED prediction device (Median edge detector), and directly encodes a prediction error. There is no image degradation because quantization is not performed in the third conventional technology. However, each process is heavy because, for example, a calculating process is required in encoding. Therefore the third conventional technology is unsuitable for real-time compression.
If the quantization is simply performed using the DPCM as the above-mentioned first conventional technology, there occurs the problem that a quantization error propagates in the direction of the line. In addition, in the transfer and encoding using a DCT such as the JPEG, the MPEG, etc. as the above-mentioned second conventional technology, there occurs the problem that image degradation is conspicuous on CG images, and there also occurs the problem that although adaptive quantization is performed, no correction or feedback can be performed by detecting image degradation by a quantization error because an edge is extracted from a compressing target block. Furthermore, in the JPEG-LS as the above-mentioned third conventional technology, quantization is not performed and therefore no image degradation occurs, but each process is heavy and is not appropriate for real-time processing.
Patent Document 1: Japanese Published Patent Application No. H10-126777
Patent Document 2: Japanese Published Patent Application No. H6-350992